/*
 * Copyright 2024, Cypress Semiconductor Corporation (an Infineon company)
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "whd.h"
#include "bus_protocols/whd_bus_protocol_interface.h"

#ifdef GCI_SECURE_ACCESS
#include "whd_hw.h"
#endif

#ifndef INCLUDED_CUSTOM_WHD_BUS_PROTOCOL_H
#define INCLUDED_CUSTOM_WHD_BUS_PROTOCOL_H

#ifdef __cplusplus
extern "C" {
#endif

//==================================================================================================
// Macro for access to hardware registers/WLAN Registers
//==================================================================================================
#ifndef REG32
#define REG32(address)    (*(volatile uint32_t *)(address) )
#endif

#ifndef REG16
#define REG16(address)    (*(volatile uint16_t *)(address) )
#endif

#ifndef REG8
#define REG8(address)     (*(volatile uint8_t *)(address) )
#endif

/******************************************************
*             Function declarations
******************************************************/
extern void whd_delayed_bus_release_schedule_update(whd_driver_t whd_driver, whd_bool_t is_scheduled);
#define DELAYED_BUS_RELEASE_SCHEDULE(whd_driver, schedule) \
    do {  whd_delayed_bus_release_schedule_update(whd_driver, schedule); } while (0)


/******************************************************
*             Global variables
******************************************************/


#ifdef __cplusplus
} /*extern "C" */
#endif

#endif /* ifndef INCLUDED_CUSTOM_WHD_BUS_PROTOCOL_H */
